<!-- 
说明：交互组件:导航 
日期：2018-6-13 9:3:48 
版本：1.0.0
-->
<template>
  <div class="cm-ue-nav">
    <div class="cm-ue-nav_contain"
         @click="gotoAddress({name: 'home'})">
      <div class="cm-ue-nav_contain__content">
        <div class="cm-ue-nav_icon_home">
          <div class="cm-ue-nav_icon_home_homenormal"
               v-show="!($route.name === 'home')" />
          <div class="cm-ue-nav_icon_home_homepress"
               v-show="$route.name === 'home'" />
        </div>
      </div>
    </div>
    <div class="cm-ue-nav_contain"
         @click="gotoAddress({name: 'classify'})">
      <div class="cm-ue-nav_contain__content">
        <div class="cm-ue-nav_icon_classify">
          <div class="cm-ue-nav_icon_classify_classifynormal"
               v-show="!($route.name === 'classify')" />
          <div class="cm-ue-nav_icon_classify_classifypress"
               v-show="$route.name === 'classify'" />
        </div>
      </div>
    </div>
    <div class="cm-ue-nav_contain"
         @click="gotoAddress({name: 'shopcat'})">
      <div class="cm-ue-nav_contain__content">
        <div class="cm-ue-nav_icon_shopcat">
          <div class="cm-ue-nav_icon_shopcat_shopcatnormal"
               v-show="!($route.name === 'shopcat')" />
          <div class="cm-ue-nav_icon_shopcat_shopcatpress"
               v-show="$route.name === 'shopcat'" />
        </div>
      </div>
    </div>
    <div class="cm-ue-nav_contain"
         @click="gotoAddress({name: 'mine'})">
      <div class="cm-ue-nav_contain__content">
        <div class="cm-ue-nav_icon_mine">
          <div class="cm-ue-nav_icon_mine_minenormal"
               v-show="!($route.name === 'mine')" />
          <div class="cm-ue-nav_icon_mine_minepress"
               v-show="$route.name === 'mine'" />
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import mixins from '@/mixins'

export default {
  name: 'cm-ue-nav_contain',
  mixins: [mixins],
  // extends: CmUe,
  props: {
    extend: {
      type: Object,
      default () {
        return {}
      }
    }
  },
  data () {
    return {
      title: '导航',
      navTextArrs: [
        { title: '首页' },
        { title: '分类' },
        { title: '购物车' },
        { title: '我的' }
      ],
      showType: 1
      // loadHide: false
    }
  },
  methods: {
    // 跳转指定路由
    gotoAddress (path) {
      this.$router.push(path)
    }
  }
}
</script>

<style lang="stylus">
.cm-ue-nav {
  // background-color: #fff;
  background: white;
  position: fixed;
  z-index: 300;
  left: 0;
  right: 0;
  bottom: 0;
  // width: 100%;
  height: 98px;
  display: flex;
  background: rgba(255, 255, 255, 1);
  box-shadow: 0px -1px 0px 0px rgba(198, 198, 198, 0.5);
}

.cm-ue-nav_contain {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
}

.cm-ue-nav_contain__content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  .cm-ue-nav_icon_home {
    width: 44px;
    height: 44px;
    fill: #929292;
    font-size: 22px;

    img {
      width: 47px;
      height: 32px;
    }

    .cm-ue-nav_icon_home_homepress {
      width: 44px;
      height: 44px;
      background-image: url('~@image/home-press.png');
      background-size: 44px 38px;
      background-repeat: no-repeat;
    }

    .cm-ue-nav_icon_home_homenormal {
      width: 44px;
      height: 38px;
      background-image: url('~@image/home-normal.png');
      background-size: 44px 38px;
      background-repeat: no-repeat;
    }
  }

  .cm-ue-nav_icon_classify {
    width: 45px;
    height: 44px;
    fill: #929292;

    img {
      width: 45px;
      height: 44px;
    }

    .cm-ue-nav_icon_classify_classifypress {
      width: 45px;
      height: 44px;
      background-image: url('~@image/classify-press.png');
      background-size: 45px 44px;
      background-repeat: no-repeat;
    }

    .cm-ue-nav_icon_classify_classifynormal {
      width: 45px;
      height: 44px;
      background-image: url('~@image/classify-normal.png');
      background-size: 45px 44px;
      background-repeat: no-repeat;
    }
  }

  .cm-ue-nav_icon_shopcat {
    width: 47px;
    height: 44px;
    fill: #929292;

    img {
      width: 47px;
      height: 44px;
    }

    .cm-ue-nav_icon_shopcat_shopcatnormal {
      width: 47px;
      height: 44px;
      background-image: url('~@image/shop-normal.png');
      background-size: 47px 44px;
      background-repeat: no-repeat;
    }

    .cm-ue-nav_icon_shopcat_shopcatpress {
      width: 47px;
      height: 44px;
      background-image: url('~@image/shop-press.png');
      background-size: 47px 44px;
      background-repeat: no-repeat;
    }
  }

  .cm-ue-nav_icon_mine {
    width: 38px;
    height: 44px;
    fill: #929292;

    img {
      width: 38px;
      height: 44px;
    }

    .cm-ue-nav_icon_mine_minepress {
      width: 38px;
      height: 44px;
      background-image: url('~@image/mine-press.png');
      background-size: 38px 44px;
      background-repeat: no-repeat;
    }

    .cm-ue-nav_icon_mine_minenormal {
      width: 38px;
      height: 44px;
      background-image: url('~@image/mine-normal.png');
      background-size: 38px 44px;
      background-repeat: no-repeat;
    }
  }

  .selected {
    font-size: 22px;
    font-family: PingFangSC-Regular;
    color: rgba(227, 20, 54, 1);
  }

  span {
    /* padding-top: 2px; */
    font-size: 22px;
    font-family: PingFangSC-Regular;
    color: rgba(51, 51, 51, 1);
  }
}
</style>
